\(\int (f x)^m (a+b \log (c x^n)) \, dx\) [321]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 16, antiderivative size = 46 \[ \int (f x)^m \left (a+b \log \left (c x^n\right )\right ) \, dx=-\frac {b n (f x)^{1+m}}{f (1+m)^2}+\frac {(f x)^{1+m} \left (a+b \log \left (c x^n\right )\right )}{f (1+m)} \]

[Out]

-b*n*(f*x)^(1+m)/f/(1+m)^2+(f*x)^(1+m)*(a+b*ln(c*x^n))/f/(1+m)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {2341} \[ \int (f x)^m \left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {(f x)^{m+1} \left (a+b \log \left (c x^n\right )\right )}{f (m+1)}-\frac {b n (f x)^{m+1}}{f (m+1)^2} \]

[In]

Int[(f*x)^m*(a + b*Log[c*x^n]),x]

[Out]

-((b*n*(f*x)^(1 + m))/(f*(1 + m)^2)) + ((f*x)^(1 + m)*(a + b*Log[c*x^n]))/(f*(1 + m))

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rubi steps \begin{align*} \text {integral}& = -\frac {b n (f x)^{1+m}}{f (1+m)^2}+\frac {(f x)^{1+m} \left (a+b \log \left (c x^n\right )\right )}{f (1+m)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.70 \[ \int (f x)^m \left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {x (f x)^m \left (a+a m-b n+b (1+m) \log \left (c x^n\right )\right )}{(1+m)^2} \]

[In]

Integrate[(f*x)^m*(a + b*Log[c*x^n]),x]

[Out]

(x*(f*x)^m*(a + a*m - b*n + b*(1 + m)*Log[c*x^n]))/(1 + m)^2

Maple [A] (verified)

Time = 0.00 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.48

method result size
parallelrisch \(-\frac {-x \left (f x \right )^{m} \ln \left (c \,x^{n}\right ) b m -x \left (f x \right )^{m} \ln \left (c \,x^{n}\right ) b -x \left (f x \right )^{m} a m +x \left (f x \right )^{m} b n -x \left (f x \right )^{m} a}{\left (1+m \right )^{2}}\) \(68\)
risch \(\frac {b x \,x^{m} f^{m} {\mathrm e}^{\frac {i \operatorname {csgn}\left (i f x \right ) \pi m \left (\operatorname {csgn}\left (i f x \right )-\operatorname {csgn}\left (i x \right )\right ) \left (-\operatorname {csgn}\left (i f x \right )+\operatorname {csgn}\left (i f \right )\right )}{2}} \ln \left (x^{n}\right )}{1+m}-\frac {\left (i \pi b \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) m -i \pi b \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} m -i \pi b \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} m +i \pi b \operatorname {csgn}\left (i c \,x^{n}\right )^{3} m +i b \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )-i b \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}-i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}-2 b \ln \left (c \right ) m -2 b \ln \left (c \right )-2 a m +2 b n -2 a \right ) x \,x^{m} f^{m} {\mathrm e}^{\frac {i \operatorname {csgn}\left (i f x \right ) \pi m \left (\operatorname {csgn}\left (i f x \right )-\operatorname {csgn}\left (i x \right )\right ) \left (-\operatorname {csgn}\left (i f x \right )+\operatorname {csgn}\left (i f \right )\right )}{2}}}{2 \left (1+m \right )^{2}}\) \(305\)

[In]

int((f*x)^m*(a+b*ln(c*x^n)),x,method=_RETURNVERBOSE)

[Out]

-(-x*(f*x)^m*ln(c*x^n)*b*m-x*(f*x)^m*ln(c*x^n)*b-x*(f*x)^m*a*m+x*(f*x)^m*b*n-x*(f*x)^m*a)/(1+m)^2

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.13 \[ \int (f x)^m \left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {{\left ({\left (b m + b\right )} n x \log \left (x\right ) + {\left (b m + b\right )} x \log \left (c\right ) + {\left (a m - b n + a\right )} x\right )} e^{\left (m \log \left (f\right ) + m \log \left (x\right )\right )}}{m^{2} + 2 \, m + 1} \]

[In]

integrate((f*x)^m*(a+b*log(c*x^n)),x, algorithm="fricas")

[Out]

((b*m + b)*n*x*log(x) + (b*m + b)*x*log(c) + (a*m - b*n + a)*x)*e^(m*log(f) + m*log(x))/(m^2 + 2*m + 1)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 141 vs. \(2 (37) = 74\).

Time = 2.18 (sec) , antiderivative size = 141, normalized size of antiderivative = 3.07 \[ \int (f x)^m \left (a+b \log \left (c x^n\right )\right ) \, dx=\begin {cases} \frac {a m x \left (f x\right )^{m}}{m^{2} + 2 m + 1} + \frac {a x \left (f x\right )^{m}}{m^{2} + 2 m + 1} + \frac {b m x \left (f x\right )^{m} \log {\left (c x^{n} \right )}}{m^{2} + 2 m + 1} - \frac {b n x \left (f x\right )^{m}}{m^{2} + 2 m + 1} + \frac {b x \left (f x\right )^{m} \log {\left (c x^{n} \right )}}{m^{2} + 2 m + 1} & \text {for}\: m \neq -1 \\\frac {\begin {cases} a \log {\left (x \right )} & \text {for}\: b = 0 \\- \left (- a - b \log {\left (c \right )}\right ) \log {\left (x \right )} & \text {for}\: n = 0 \\\frac {\left (- a - b \log {\left (c x^{n} \right )}\right )^{2}}{2 b n} & \text {otherwise} \end {cases}}{f} & \text {otherwise} \end {cases} \]

[In]

integrate((f*x)**m*(a+b*ln(c*x**n)),x)

[Out]

Piecewise((a*m*x*(f*x)**m/(m**2 + 2*m + 1) + a*x*(f*x)**m/(m**2 + 2*m + 1) + b*m*x*(f*x)**m*log(c*x**n)/(m**2
+ 2*m + 1) - b*n*x*(f*x)**m/(m**2 + 2*m + 1) + b*x*(f*x)**m*log(c*x**n)/(m**2 + 2*m + 1), Ne(m, -1)), (Piecewi
se((a*log(x), Eq(b, 0)), (-(-a - b*log(c))*log(x), Eq(n, 0)), ((-a - b*log(c*x**n))**2/(2*b*n), True))/f, True
))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.24 \[ \int (f x)^m \left (a+b \log \left (c x^n\right )\right ) \, dx=-\frac {b f^{m} n x x^{m}}{{\left (m + 1\right )}^{2}} + \frac {\left (f x\right )^{m + 1} b \log \left (c x^{n}\right )}{f {\left (m + 1\right )}} + \frac {\left (f x\right )^{m + 1} a}{f {\left (m + 1\right )}} \]

[In]

integrate((f*x)^m*(a+b*log(c*x^n)),x, algorithm="maxima")

[Out]

-b*f^m*n*x*x^m/(m + 1)^2 + (f*x)^(m + 1)*b*log(c*x^n)/(f*(m + 1)) + (f*x)^(m + 1)*a/(f*(m + 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 95 vs. \(2 (46) = 92\).

Time = 0.33 (sec) , antiderivative size = 95, normalized size of antiderivative = 2.07 \[ \int (f x)^m \left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {b f^{m} m n x x^{m} \log \left (x\right )}{m^{2} + 2 \, m + 1} + \frac {b f^{m} n x x^{m} \log \left (x\right )}{m^{2} + 2 \, m + 1} - \frac {b f^{m} n x x^{m}}{m^{2} + 2 \, m + 1} + \frac {\left (f x\right )^{m} b x \log \left (c\right )}{m + 1} + \frac {\left (f x\right )^{m} a x}{m + 1} \]

[In]

integrate((f*x)^m*(a+b*log(c*x^n)),x, algorithm="giac")

[Out]

b*f^m*m*n*x*x^m*log(x)/(m^2 + 2*m + 1) + b*f^m*n*x*x^m*log(x)/(m^2 + 2*m + 1) - b*f^m*n*x*x^m/(m^2 + 2*m + 1)
+ (f*x)^m*b*x*log(c)/(m + 1) + (f*x)^m*a*x/(m + 1)

Mupad [F(-1)]

Timed out. \[ \int (f x)^m \left (a+b \log \left (c x^n\right )\right ) \, dx=\int {\left (f\,x\right )}^m\,\left (a+b\,\ln \left (c\,x^n\right )\right ) \,d x \]

[In]

int((f*x)^m*(a + b*log(c*x^n)),x)

[Out]

int((f*x)^m*(a + b*log(c*x^n)), x)